home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / etc / edt-user.doc.z / edt-user.doc
Encoding:
Text File  |  1998-05-21  |  35.3 KB  |  783 lines

  1. File:  edt-user.doc  ---  EDT Emulation User Instructions
  2.  
  3.                                 For GNU Emacs 19
  4.  
  5. Copyright (C) 1986, 1992, 1994, 1995 Free Software Foundation, Inc.
  6.  
  7. Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
  8. Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
  9. Keywords: emulations
  10.  
  11. This file is part of GNU Emacs.
  12.  
  13. GNU Emacs is free software; you can redistribute it and/or modify
  14. it under the terms of the GNU General Public License as published by
  15. the Free Software Foundation; either version 2, or (at your option)
  16. any later version.
  17.  
  18. GNU Emacs is distributed in the hope that it will be useful,
  19. but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  21. GNU General Public License for more details.
  22.  
  23. You should have received a copy of the GNU General Public License
  24. along with GNU Emacs; see the file COPYING.  If not, write to the
  25. Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  26. Boston, MA 02111-1307, USA.
  27.  
  28. ============================================================================
  29.  
  30. I.    OVERVIEW:
  31.  
  32. This version of the EDT emulation package for GNU Emacs is a substantially
  33. enhanced version of the original.  A large part of the original can still be
  34. found here, of course, but much of it has been modified and quite a bit is
  35. new.  Many of the ideas found here are borrowed from others.  In particular,
  36. some of the code found here was drawn from an earlier re-write of the EDT
  37. package done at DSC in 1989 by Matthew Frohman.
  38.    
  39. Send bug fixes, suggestions for enhancements, and corrections to this
  40. documentation to Kevin Gallagher (kgallagh@spd.dsccc.com).
  41.  
  42. The EDT emulation consists of the following files:
  43.  
  44. edt-user.doc          - User instructions (which you are reading now)
  45. edt.el                - EDT Emulation Functions and Default Configuration
  46. edt-lk201.el          - Support for DEC LK-201 Keyboards
  47. edt-vt100.el          - Support for DEC VT-100 (and above) terminals
  48. edt-mapper.el         - Support for Keyboards used under X Windows
  49. edt-pc.el             - Support for the PC AT Keyboard under MS-DOS
  50.  
  51. Several goals were kept in mind when making this version:
  52.      
  53.         1.  Emulate EDT Keypad Mode commands closely so that current
  54.             EDT users will find that it easy and comfortable to use
  55.             GNU Emacs with a small learning curve;
  56.    
  57.         2.  Make it easy for a user to customize EDT emulation key
  58.             bindings without knowing much about Emacs Lisp;
  59.  
  60.         3.  Make it easy to switch between the original EDT default bindings
  61.             and the user's customized bindings, without having to exit Emacs.
  62.  
  63.         4.  Provide support for some TPU/EVE functions not supported in
  64.             EDT. 
  65.  
  66.         5.  Provide an easy way to restore ALL original Emacs key bindings,
  67.             just as they existed before the EDT emulation was first invoked.
  68.    
  69.         6.  Support GNU Emacs 19.  (Support for GNU Emacs 18 has been dropped.
  70.             Also, although there is some code designed to support Xemacs 19
  71.             (formerly Lucid Emacs), this is not fully implemented at this
  72.             time. 
  73.  
  74.         7.  When running under X, support highlighting of marked text.
  75.  
  76.         8.  Handle terminal configuration under X interactively when the
  77.             emulation is invoked for the first time.
  78.  
  79.         9.  Support a PC AT keyboard under MS-DOS.
  80.  
  81. II.   TERMINALS/KEYBOARDS SUPPORTED:
  82.  
  83. Keyboards used under X Windows are supported via the edt-mapper function.  The
  84. first time you invoke the emulation under X, the edt-mapper function is run
  85. automatically and the user is prompted to identify which keys the emulation is
  86. to use for the standard keypad and function keys EDT expects (e.g., PF1, PF2,
  87. etc.).  This configuration is saved to disk read each time the emulation is
  88. invoked.
  89.  
  90. In character oriented connections not running a window manager, the following
  91. terminals/keyboards are supported.  (1) DEC VT-100 series and higher.  This
  92. includes well behaved VT clones and emulators.  If you are using a VT series
  93. terminal, be sure that the term environment variable is set properly before
  94. invoking emacs. (2) PC AT keyboard under MS-DOS.
  95.  
  96. Be sure to read the SPECIAL NOTES FOR SOME PLATFORMS sections to see if those
  97. notes apply to you.
  98.  
  99.  
  100. III.  STARTING THE EDT EMULATION:
  101.  
  102. Start up GNU Emacs and enter "M-x edt-emulation-on" to begin the emulation.
  103. After initialization is complete, the following message will appear below the
  104. status line informing you that the emulation has been enabled:
  105.  
  106.                          Default EDT keymap active
  107.  
  108. You can have the EDT Emulation start up automatically, each time you initiate
  109. a GNU Emacs session, by adding the following line to your .emacs file:
  110.  
  111.                   (setq term-setup-hook 'edt-emulation-on)
  112.  
  113. A reference sheet is included (later on) listing the default EDT Emulation key
  114. bindings.  This sheet is also accessible on line from within Emacs by pressing
  115. PF2, GOLD H, or HELP (when in the EDT Default Mode).
  116.  
  117. It is easy to customize key bindings in the EDT Emulation.  (See CUSTOMIZING
  118. section, below.)  Customizations are placed in a file called edt-user.el.  (A
  119. sample edt-user.el file can be found in the CUSTOMIZING section.)  If
  120. edt-user.el is found in your GNU Emacs load path during EDT Emulation
  121. initialization, then the following message will appear below the status line
  122. indicating that the emulation has been enabled, enhanced by your own
  123. customizations:
  124.  
  125.                        User EDT custom keymap active
  126.  
  127. Once enabled, it is easy to switch back and forth between your customized EDT
  128. Emulation key bindings and the default EDT Emulation key bindings.  It is also
  129. easy to turn off the emulation.  Doing so completely restores the original key
  130. bindings in effect just prior to invoking the emulation.
  131.  
  132. Where EDT key bindings and GNU Emacs key bindings conflict, the default GNU
  133. Emacs key bindings are retained by the EDT emulation by default.  If you are a
  134. diehard EDT user you may not like this.  The CUSTOMIZING section explains how
  135. to change this default.
  136.  
  137.  
  138. IV.   SPECIAL NOTES FOR SOME PLATFORMS:
  139.  
  140.   Sun Workstations running X:
  141.  
  142.      Some earlier Sun keyboards do not have arrow keys separate from the
  143.      keypad keys.  It is difficult to emulate the full EDT keypad and still
  144.      retain use of the arrow keys on such keyboards.  
  145.  
  146.      The Sun Type 5 keyboard, however, does have separate arrow keys.  This
  147.      makes it a candidate for setting up a reasonable EDT keypad emulation.
  148.      Unfortunately, Sun's default X keynames for the keypad keys don't permit
  149.      GNU Emacs to interpret the keypad 2, 4, 6, and 8 keys as something other
  150.      than arrow keys, nor use all the top row of keys for PF1 thru PF4 keys.
  151.      Here's the contents of an .xmodmaprc file which corrects this problem for
  152.      Sun Type 5 keyboards:
  153.  
  154.          ! File:  .xmodmaprc
  155.          !
  156.          ! Set up Sun Type 5 keypad for use with the GNU Emacs EDT Emulation
  157.          !
  158.          keycode  53 = KP_Divide
  159.          keycode  54 = KP_Multiply
  160.          keycode  57 = KP_Decimal
  161.          keycode  75 = KP_7
  162.          keycode  76 = KP_8
  163.          keycode  77 = KP_9
  164.          keycode  78 = KP_Subtract
  165.          keycode  97 = KP_Enter
  166.          keycode  98 = KP_4
  167.          keycode  99 = KP_5
  168.          keycode 100 = KP_6
  169.          keycode 101 = KP_0
  170.          keycode 105 = F24
  171.          keycode 119 = KP_1
  172.          keycode 120 = KP_2
  173.          keycode 121 = KP_3
  174.          keycode 132 = KP_Add
  175.  
  176.      Feed .xmodmaprc to the xmodmap command and all the Sun Type 5 keypad keys
  177.      will now be configurable for the emulation of an LK-201 keypad (less the
  178.      comma key).  The line
  179.  
  180.          keycode 105 = F24
  181.  
  182.      modifies the NumLock key to be the F24 key which can then be configured
  183.      to behave as the PF1 key.  In doing so, you will no longer have a NumLock
  184.      key.  If you are using other software under X which requires a NumLock
  185.      key, then examine your keyboard and look for one you don't use and
  186.      redefine it to be the NumLock key.  (See the man page on xmodmap for for
  187.      further help on how to do this.)
  188.  
  189.   PC users running MS-DOS:
  190.  
  191.      By default, F1 is configured to emulate the PF1 (GOLD) key.  But NumLock
  192.      can be used instead if you load a freeware TSR distributed with
  193.      MS-Kermit, call gold.com.  It is distributed in a file called gold22.zip
  194.      and comes with the source code as well as a loadable binary image. 
  195.      (See edt-pc.el for more information.)
  196.  
  197.   PC users running Linux:
  198.  
  199.      The default X server configuration of three keys PC AT keyboard keys
  200.      needs to be modified to permit the PC keyboard to emulate an LK-201
  201.      keyboard properly.  Here's the contents of an .xmodmaprc file which makes
  202.      these changes for your:
  203.  
  204.          ! File:  .xmodmaprc
  205.          !
  206.          ! Set up PC keypad under Linux for the GNU Emacs EDT Emulation 
  207.          !
  208.          keycode  22 = BackSpace
  209.          keycode  77 = F12
  210.          keycode  96 = Num_Lock
  211.  
  212.      Feed the file to the xmodmap command and all the PC keypad keys will now
  213.      be configurable for the emulation of an LK-201 keypad (less the comma
  214.      key), the standard keyboard supplied with DEC terminals VT-200 and above.
  215.      This file switches the role of the F12 and NumLock keys.  It also
  216.      modifies the definition of the Delete key above the arrow keys so that it
  217.      can be assigned a keybinding independently of the the BackSpace key.
  218.  
  219.      NOTE: It is necessary to have NumLock ON for the PC keypad to emulate the
  220.      LK-201 keypad properly.
  221.  
  222.  
  223. V.    HOW DOES THIS EDT EMULATION DIFFER FROM REAL EDT?:
  224.  
  225. In general, you will find that this emulation of EDT replicates most, but not
  226. all, of EDT's most used Keypad Mode editing functions and behavior.  It is not
  227. perfect, but most EDT users who have tried the emulation agree that it is
  228. quite good enough to make it easy for die-hard EDT users to move over to using
  229. GNU Emacs.  
  230.  
  231. Here's a list of the most important differences between EDT and this GNU Emacs
  232. EDT Emulation.  The list is short but you must be aware of these differences
  233. if you are to use the EDT Emulation effectively.
  234.  
  235. 1.  Entering repeat counts works a little differently than in EDT.
  236.  
  237.     EDT allows users to enter a repeat count before entering a command that
  238.     accepts repeat counts.  For example, when in EDT, pressing these three
  239.     keys in sequence, GOLD 5 KP1, will move the cursor in the current
  240.     direction 5 words.
  241.  
  242.     Emacs provides two ways to enter repeat counts, though neither involves
  243.     using the GOLD key.  In Emacs, repeat counts can be entered by using the 
  244.     ESC key.  For example, pressing these keys in sequence, ESC 1 0 KP1, will
  245.     move the cursor in the current direction 10 words. 
  246.  
  247.     Emacs provides another command called universal-argument that can do the
  248.     same thing, plus a few other things.  Normally, Emacs has this bound to
  249.     C-u.  
  250.  
  251. 2.  The EDT SUBS command, bound to GOLD ENTER, is NOT supported.  The built-in
  252.     Emacs query-replace command has been bound to GOLD ENTER, instead.  It is
  253.     much more convenient to use than SUBS.
  254.  
  255. 3.  EDT's line mode commands and nokeypad mode commands are NOT supported
  256.     (with one important exception; see item 8 in the Highlights section
  257.     below).  Although, at first, this may seem like a big omission, the set of
  258.     built-in Emacs commands provides a much richer set of capabilities which
  259.     more than make up for this omission.
  260.  
  261.     To enter Emacs commands not bound to keys, you can press GOLD KP7 or the
  262.     DO key.  Emacs will display it's own command prompt called Meta-x (M-x).
  263.     You can also invoke this prompt the normal Emacs way by entering ESC x.
  264.  
  265. 4.  Selected text is highlighted ONLY when running under X Windows.  Gnu Emacs
  266.     19 does not support highlighting of text on VT series terminals, at this
  267.     time. 
  268.  
  269. 5.  Just like TPU/EVE, The ENTER key is NOT used to terminate input when the
  270.     editor prompts you for input.  The RETURN key is used, instead.  (KP4 and
  271.     KP5 do terminate input for the FIND command, just like in EDT, however.)
  272.  
  273.  
  274.  
  275.  
  276. VI.   SOME HIGHLIGHTS IN THIS EDT EMULATION, AND SOME COMPARISONS TO THE
  277.       ORIGINAL GNU EMACS EDT EMULATION:
  278.  
  279. 1.  The EDT define key command is supported (edt-define-key) and is bound to
  280.     C-k in the default EDT mode when EDT control sequence bindings are enabled
  281.     or one of the sample edt-user.el customization files is used.  The TPU/EVE
  282.     learn command is supported but not bound to a key in the default EDT mode
  283.     but is bound in the sample edt-user.el files.
  284.  
  285.     Unlike the TPU/EVE learn command, which uses one key to begin the learn
  286.     sequence, C-l, and another command to remember the sequence, C-r, this
  287.     version of the learn command (edt-learn) serves as a toggle to both begin
  288.     and to remember the learn sequence.
  289.  
  290.     Many users who change the meaning of a key with the define key and the
  291.     learn commands, would like to be able to restore the original key binding
  292.     without having to quit and restart emacs.  So a restore key command is
  293.     provided to do just that.  When invoked, it prompts you to press the key
  294.     to which you wish the last replaced key definition restored.  It is bound
  295.     to GOLD C-k in the default EDT mode when EDT control sequence bindings are
  296.     enabled or one of the sample edt-user.el customization files is used.
  297.  
  298. 2.  Direction support is fully supported.  It is no longer accomplished by
  299.     re-defining keys each time the direction is changed.  Thus, commands
  300.     sensitive to the current direction setting may be bound easily to any key.
  301.  
  302. 3.  All original emacs bindings are fully restored when EDT emulation is
  303.     turned off.
  304.  
  305. 4.  User custom EDT bindings are kept separate from the default EDT bindings.
  306.     One can toggle back and forth between the custom EDT bindings and default
  307.     EDT bindings.
  308.  
  309. 5.  The Emacs functions in edt.el attempt to emulate, where practical, the
  310.     exact behavior of the corresponding EDT keypad mode commands.  In a few
  311.     cases, the emulation is not exact, but we hope you will agree it is close
  312.     enough.  In a very few cases, we chose to use the Emacs way of handling
  313.     things.  As mentioned earlier, we do not emulate the EDT SUBS command.
  314.     Instead, we chose to use the Emacs query-replace function, which we find
  315.     to be easier to use.
  316.  
  317. 6.  Emacs uses the regexp assigned to page-delimiter to determine what marks a
  318.     page break.  This is normally "^\f", which causes the edt-page command to
  319.     ignore form feeds not located at the beginning of a line.  To emulate the
  320.     EDT PAGE command exactly, page-delimiter is set to "\f" when EDT emulation
  321.     is turned on, and restored to "^\f" when EDT emulation is turned off.
  322.     But, since some users prefer the Emacs definition of a page break, or may
  323.     wish to preserve a customized definition of page break, one can override
  324.     the EDT definition by placing
  325.  
  326.             (setq edt-keep-current-page-delimiter t)
  327.  
  328.     in your .emacs file.
  329.  
  330. 7.  The EDT definition of a section of a terminal window is hardwired to be 16
  331.     lines of its one-and-only 24-line window (the EDT SECT command bound to
  332.     KP8).  That's two-thirds of the window at a time.  Since Emacs, like
  333.     TPU/EVE, can handle multiple windows of sizes of other than 24 lines, the
  334.     definition of section used here has been modified to two-thirds of the
  335.     current window.  (There is also an edt-scroll-window function which you
  336.     may prefer over the SECT emulation.)
  337.  
  338. 8.  Cursor movement and deletion involving word entities is identical to EDT.
  339.     This, above all else, gives the die-hard EDT user a sense of being at
  340.     home.  Also, an emulation of EDT's SET ENTITY WORD command is provided,
  341.     for those users who like to customize movement by a word at a time to
  342.     their own liking.
  343.  
  344. 9.  EDT's FIND and FNDNXT are supported.
  345.  
  346. 10. EDT's APPEND and REPLACE commands are supported.
  347.  
  348. 11. CHNGCASE is supported.  It works on individual characters or selected
  349.     text, if SELECT is active.  In addition, two new commands are provided:
  350.     edt-lowercase and edt-uppercase.  They work on individual WORDS or
  351.     selected text, if SELECT is active.
  352.  
  353. 12. Form feed and tab insert commands are supported.
  354.  
  355. 13. A new command, edt-duplicate-word, is provided.  If you experiment with
  356.     it, you might find it to be surprisingly useful and may wonder how you
  357.     ever got along without it!  It is assigned to C-j in the sample
  358.     edt-user.el customization files.
  359.  
  360. 14. TPU/EVE's Rectangular Cut and Paste functions (originally from the EVE-Plus
  361.     package) are supported.  But unlike the TPU/EVE versions, these here
  362.     support both insert and overwrite modes.  The seven rectangular functions
  363.     are bound to F7, F8, GOLD-F8, F9, GOLD-F9, F10, and GOLD-F10 in the
  364.     default EDT mode.
  365.  
  366. 15. The original EDT emulation package set up many default regular and GOLD
  367.     bindings.  We tried to preserve most (but not all!) of these, so users of
  368.     the original emulation package will feel more at home.  
  369.  
  370.     Nevertheless, there are still many GOLD key sequences which are not bound
  371.     to any functions.  These are prime candidates to use for your own 
  372.     customizations.  
  373.     
  374.     Also, there are several commands in edt.el not bound to any key.  So, you
  375.     will find it worthwhile to look through edt.el for functions you may wish
  376.     to add to your personal customized bindings.
  377.  
  378. 16. The VT200/VT300 series terminals steal the function keys F1 to F5 for
  379.     their own use.  These do not generate signals which are sent to the host.
  380.     So, edt.el does not assign any default bindings to F1 through F5.
  381.  
  382.     In addition, our VT220 terminals generate an interrupt when the F6 key is
  383.     pressed (^C or ^Y, can't remember which) and not the character sequence
  384.     documented in the manual.  So, binding emacs commands to F6 will not work
  385.     if your terminal behaves the same way.
  386.  
  387. 17. The VT220 terminal has no ESC, BS, nor LF keys, as does a VT100.  So the
  388.     default EDT bindings adopt the standard DEC convention of having the F11,
  389.     F12, and F13 keys, on a VT200 series (and above) terminal, assigned to the
  390.     same EDT functions that are bound to ESC, BS, and LF on a VT100 terminal.
  391.  
  392. 18. Each user, through the use of a private edt-user.el file, can customize,
  393.     very easily, personal EDT emulation bindings.
  394.  
  395. 19. The EDT SELECT and RESET functions are supported.  However, unlike EDT,
  396.     pressing RESET to cancel text selection does NOT reset the existing
  397.     setting of the current direction.
  398.  
  399.     We also provide a TPU/EVE like version of the single SELECT/RESET
  400.     function, called edt-toggle-select, which makes the EDT SELECT function
  401.     into a toggle on/off switch.  That is, if selection is ON, pressing SELECT
  402.     again turns selection off (cancels selection).  This function is used in
  403.     the sample edt-user.el customization files.
  404.  
  405.  
  406. VII.  CUSTOMIZING:
  407.  
  408. Most EDT users, at one time or another, make some custom key bindings, or
  409. use someone else's custom key bindings, which they come to depend upon just as
  410. if they were built-in bindings.  This EDT Emulation for GNU Emacs is designed
  411. to make it easy to customize bindings.
  412.  
  413. If you wish to customize the EDT Emulation to use some of your own key
  414. bindings, you need to make a private version of edt-user.el in your own
  415. private lisp directory.  There are two sample files edt-user.el1 and
  416. edt-user.el2 for you to use as templates and for ideas.  Look at
  417. edt-user.el1 first.  Unless you will be using two or more very different
  418. types of terminals on the same system, you need not look at edt-user.el2.
  419.  
  420. First, you need to have your own private lisp directory, say ~/lisp, and
  421. you should add it to the GNU Emacs load path.
  422.  
  423. NOTE:  A few sites have different load-path requirements, so the above
  424.        directions may need some modification if your site has such special
  425.        needs. 
  426.  
  427.  
  428. Creating your own edt-user.el file:
  429.  
  430. A sample edt-user.el file is attached to the end of this user documentation.
  431. You should use it as a guide to learn how you can customize EDT emulation
  432. bindings to your own liking.  Names used to identify the set of LK-201
  433. keypad and function keys are:
  434.  
  435. Keypad Keys:   
  436.                 PF1 PF2 PF3 PF4
  437.                 KP7 KP8 KP9 KP-
  438.                 KP4 KP5 KP6 KP,
  439.                 KP1 KP2 KP3 
  440.                 KP0     KPP KPE
  441.  
  442. Arrow Keys:
  443.                 LEFT RIGHT DOWN UP
  444.  
  445. Function Keys:
  446.                 F1 F2 F3 F4 F5  F6 F7 F8 F9 F10  F11 F12 F13 F14
  447.                 HELP DO  F17 F18 F19 F20
  448.  
  449.                 FIND   INSERT   REMOVE 
  450.                 SELECT PREVIOUS NEXT
  451.  
  452. Note:
  453.                 Many VT-200 terminals, and above, steal function keys F1 thru
  454.                 F5 for terminal setup control and don't send anything to the
  455.                 host if pressed.  So customizing bindings to these keys may
  456.                 not work for you.
  457.  
  458. There are three basic functions that do the EDT emulation bindings:
  459. edt-bind-standard-key, edt-bind-gold-key, and edt-bind-function-key.
  460.  
  461. The first two are for binding functions to keys which are standard across most
  462. keyboards.  This makes them keyboard independent, making it possible to define
  463. these key bindings for all terminals in the file edt.el.
  464.  
  465. The first, edt-bind-standard-key, is used typically to bind emacs commands to
  466. control keys, although some people use it to bind commands to other keys, as
  467. well.  (For example, some people use it to bind the VT200 seldom used
  468. back-tick key (`) to the function "ESC-prefix" so it will behave like an ESC
  469. key.)  The second function, edt-bind-gold-key, is used to bind emacs commands
  470. to gold key sequences involving alpha-numeric keys, special character keys,
  471. and control keys.
  472.  
  473. The third function, edt-bind-function-key, is terminal dependent and is
  474. defined in a terminal specific file (see edt-vt100.el for example).  It is
  475. used to bind emacs commands to function keys, to keypad keys, and to gold
  476. sequences of those keys.
  477.  
  478. WARNING: Each of the three functions, edt-bind-function-key,
  479.          edt-bind-gold-key, and edt-bind-standard-key, has an optional
  480.          last argument.  The optional argument should NOT be used in
  481.          edt-user.el!  When the optional argument is missing, each
  482.          function knows to make the key binding part of the user's EDT
  483.          custom bindings, which is what you want to do in edt-user.el!
  484.  
  485.          The EDT default bindings are set up in edt.el by calling these
  486.          same functions with the optional last argument set to "t".  So, if
  487.          you decide to copy such function calls from edt.el to edt-user.el
  488.          for subsequent modification, BE SURE TO DELETE THE "t" AT THE END
  489.          OF EACH PARAMETER LIST!
  490.  
  491.  
  492. SPECIFYING WORD ENTITIES:
  493.  
  494. The variable edt-word-entities is used to emulate EDT's SET ENTITY WORD
  495. command.  It contains a list of characters to be treated as words in
  496. themselves.  If the user does not define edt-word-entities in his/her .emacs
  497. file, then it is set up with the EDT default containing only TAB.
  498.  
  499. The characters are stored in the list by their numerical values, not as
  500. strings.  Emacs supports several ways to specify the numerical value of a
  501. character.  One method is to use the question mark: ?A means the numerical
  502. value for A, ?/ means the numerical value for /, and so on.  Several
  503. unprintable characters have special representations:
  504.  
  505.             ?\b  specifies  BS, C-h
  506.             ?\t  specifies  TAB, C-i
  507.             ?\n  specifies  LFD, C-j
  508.             ?\v  specifies  VTAB, C-k
  509.             ?\f  specifies  FF, C-l
  510.             ?\r  specifies  CR, C-m
  511.             ?\e  specifies  ESC, C-[
  512.             ?\\  specifies  \
  513.  
  514. Here are some examples:
  515.  
  516.      (setq edt-word-entities '(?\t ?- ?/)) ;; Specifies TAB, - , and /
  517.      (setq edt-word-entities '(?\t)        ;; Specifies TAB, the default
  518.  
  519. You can also specify characters by their decimal ascii values:
  520.  
  521.      (setq edt-word-entities '(9 45 47))   ;; Specifies TAB, - , and /
  522.  
  523.  
  524. ENABLING EDT CONTROL KEY SEQUENCE BINDINGS:
  525.  
  526. Where EDT key bindings and GNU Emacs key bindings conflict, the default GNU
  527. Emacs key bindings are retained by default.  Some diehard EDT users may not
  528. like this.  So, if the variable edt-use-EDT-control-key-bindings is set to
  529. true in a user's .emacs file, then the default EDT Emulation mode will enable
  530. most of the original EDT control key sequence bindings.  If you wish to do
  531. this, add the following line to your .emacs file:
  532.  
  533.         (setq edt-use-EDT-control-key-bindings t)
  534.  
  535.  
  536.                               DEFAULT EDT Keypad
  537.  
  538.    F7: Copy Rectangle             +----------+----------+----------+----------+
  539.    F8: Cut Rect Overstrike        |Prev Line |Next Line |Bkwd Char |Frwd Char |
  540.  G-F8: Paste Rect Overstrike      |   (UP)   |  (DOWN)  |  (LEFT)  | (RIGHT)  |
  541.    F9: Cut Rect Insert            |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
  542.  G-F9: Paste Rect Insert          +----------+----------+----------+----------+
  543.   F10: Cut Rectangle
  544. G-F10: Paste Rectangle
  545.   F11: ESC                       
  546.   F12: Begining of Line           +----------+----------+----------+----------+
  547. G-F12: Delete Other Windows       |   GOLD   |   HELP   |  FNDNXT  |  DEL L   |
  548.   F13: Delete to Begin of Word    |   (PF1)  |   (PF2)  |   (PF3)  |  (PF4)   |
  549.  HELP: Keypad Help                |Mark Wisel|Desc Funct|   FIND   |  UND L   |
  550.    DO: Execute extended command   +----------+----------+----------+----------+
  551.                                   |   PAGE   |   SECT   |  APPEND  |  DEL W   |
  552.   C-g: Keyboard Quit              |    (7)   |    (8)   |    (9)   |   (-)    |
  553. G-C-g: Keyboard Quit              |Ex Ext Cmd|Fill Regio| REPLACE  |  UND W   |
  554.   C-h: Beginning of Line          +----------+----------+----------+----------+
  555. G-C-h: Emacs Help                 |  ADVANCE |  BACKUP  |   CUT    |  DEL C   |
  556.   C-i: Tab Insert                 |    (4)   |    (5)   |    (6)   |   (,)    |
  557.   C-j: Delete to Begin of Word    |   BOTTOM |    TOP   |   Yank   |  UND C   |
  558.   C-k: Define Key                 +----------+----------+----------+----------+
  559. G-C-k: Restore Key                |   WORD   |    EOL   |   CHAR   |   Next   |
  560.   C-l: Form Feed Insert           |    (1)   |    (2)   |    (3)   |  Window  |
  561.   C-n: Set Screen Width 80        | CHNGCASE |  DEL EOL |Quoted Ins|          !
  562.   C-r: Isearch Backward           +---------------------+----------+  (ENTER) |
  563.   C-s: Isearch Forward            |         LINE        |  SELECT  |          !
  564.   C-t: Display the Time           |         (0)         |    (.)   |   Query  |
  565.   C-u: Delete to Begin of Line    |      Open Line      |  RESET   |  Replace |
  566.   C-v: Redraw Display             +---------------------+----------+----------+
  567.   C-w: Set Screen Width 132       
  568.   C-z: Suspend Emacs                    +----------+----------+----------+
  569. G-C-\: Split Window                     |  FNDNXT  |   Yank   |   CUT    |
  570.                                         |  (FIND)  | (INSERT) | (REMOVE) |
  571.   G-b: Buffer Menu                      |   FIND   |          |   COPY   |
  572.   G-c: Compile                          +----------+----------+----------+
  573.   G-d: Delete Window                    |SELECT/RES|SECT BACKW|SECT FORWA|
  574.   G-e: Exit                             | (SELECT) |(PREVIOUS)|  (NEXT)  |
  575.   G-f: Find File                        |          |          |          |
  576.   G-g: Find File Other Window           +----------+----------+----------+
  577.   G-h: Keypad Help
  578.   G-i: Insert File
  579.   G-k: Toggle Capitalization Word
  580.   G-l: Lowercase Word or Region
  581.   G-m: Save Some Buffers
  582.   G-n: Next Error
  583.   G-o: Switch to Next Window
  584.   G-q: Quit
  585.   G-r: Revert File
  586.   G-s: Save Buffer
  587.   G-u: Uppercase Word or Region
  588.   G-v: Find File Other Window
  589.   G-w: Write file
  590.   G-y: EDT Emulation OFF
  591.   G-z: Switch to User EDT Key Bindings
  592.   G-1: Delete Other Windows
  593.   G-2: Split Window
  594.   G-%: Go to Percentage
  595.   G- : Undo  (GOLD Spacebar)
  596.   G-=: Go to Line
  597.   G-`: What line
  598.  
  599. ;;; File:  edt-user.el   ---  Sample User Customizations for the Enhanced 
  600. ;;;                             EDT Keypad Mode Emulation 
  601. ;;;                             
  602. ;;;                          For GNU Emacs 19
  603. ;;;
  604. ;; Copyright (C) 1986, 1992, 1993 Free Software Foundation, Inc.
  605.  
  606. ;; Author: Kevin Gallagher <kgallagh@spd.dsccc.com>
  607. ;; Maintainer: Kevin Gallagher <kgallagh@spd.dsccc.com>
  608. ;; Keywords: emulations
  609.  
  610. ;; GNU Emacs is free software; you can redistribute it and/or modify
  611. ;; it under the terms of the GNU General Public License as published by
  612. ;; the Free Software Foundation; either version 2, or (at your option)
  613. ;; any later version.
  614.  
  615. ;; GNU Emacs is distributed in the hope that it will be useful,
  616. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  617. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  618. ;; GNU General Public License for more details.
  619.  
  620. ;; You should have received a copy of the GNU General Public License
  621. ;; along with GNU Emacs; see the file COPYING.  If not, write to the
  622. ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  623. ;; Boston, MA 02111-1307, USA.
  624.  
  625. ;;; Commentary:
  626.  
  627. ;; This file contains GNU Emacs User Custom EDT bindings and functions.  In
  628. ;; this example file, there is no special test for the type of terminal being
  629. ;; used.  The assumption is that all key bindings here apply to all terminals
  630. ;; that may be used.  (In fact, it was written by an individual who uses only
  631. ;; VT series terminals when logging into a VAX.)
  632. ;;
  633. ;; WARNING: Each of the three functions, edt-bind-function-key,
  634. ;;          edt-bind-gold-key, and edt-bind-standard-key, has an optional
  635. ;;          last argument.  The optional argument should NOT be used in
  636. ;;          edt-user.el!  When the optional argument is missing, each
  637. ;;          function knows to make the key binding part of the user's EDT
  638. ;;          custom bindings, which is what you want to do in edt-user.el!
  639. ;;
  640. ;;          The EDT default bindings are set up in edt.el by calling these
  641. ;;          same functions with the optional last argument set to "t".  So, if
  642. ;;          you decide to copy such function calls from edt.el to edt-user.el
  643. ;;          for subsequent modification, BE SURE TO DELETE THE "t" AT THE END
  644. ;;          OF EACH PARAMETER LIST!
  645. ;;
  646.  
  647. ;;; Usage:
  648.  
  649. ;;  See edt-user.doc in the emacs etc directory.
  650.  
  651. ;; ====================================================================
  652.  
  653. ;;;;
  654. ;;;; Setup user custom EDT key bindings.
  655. ;;;;
  656.  
  657. (defun edt-setup-user-bindings ()
  658.   "Assigns user custom EDT Emulation keyboard bindings."
  659.  
  660.   ;; PF1 (GOLD), PF2, PF3, PF4
  661.   ;;
  662.   ;; This file MUST contain a binding of PF1 to edt-user-gold-map.  So
  663.   ;; DON'T CHANGE OR DELETE THE REGULAR KEY BINDING OF PF1 BELOW!
  664.   ;; (However, you may change the GOLD-PF1 binding, if you wish.)
  665.   (edt-bind-function-key "PF1" 'edt-user-gold-map 'edt-mark-section-wisely)
  666.   (edt-bind-function-key "PF2" 'query-replace 'other-window)
  667.   (edt-bind-function-key "PF4" 'edt-delete-entire-line 'edt-undelete-line)
  668.  
  669.   ;; EDT Keypad Keys
  670.   (edt-bind-function-key "KP1" 'edt-word-forward 'edt-change-case)
  671.   (edt-bind-function-key "KP3" 'edt-word-backward 'edt-copy)
  672.   (edt-bind-function-key "KP6" 'edt-cut-or-copy 'yank)
  673.   (edt-bind-function-key "KP8" 'edt-scroll-window 'fill-paragraph)
  674.   (edt-bind-function-key "KP9" 'open-line 'edt-eliminate-all-tabs)
  675.   (edt-bind-function-key "KPP" 
  676.              'edt-toggle-select 'edt-line-to-middle-of-window)
  677.   (edt-bind-function-key "KPE" 'edt-change-direction 'overwrite-mode)
  678.  
  679.   ;; GOLD bindings for regular keys.
  680.   (edt-bind-gold-key "a" 'edt-append)
  681.   (edt-bind-gold-key "A" 'edt-append)
  682.   (edt-bind-gold-key "h" 'edt-electric-user-keypad-help)
  683.   (edt-bind-gold-key "H" 'edt-electric-user-keypad-help)
  684.  
  685.   ;; Control bindings for regular keys.
  686.   ;;; Leave binding of C-c as original prefix key.
  687.   (edt-bind-standard-key "\C-j" 'edt-duplicate-word)
  688.   (edt-bind-standard-key "\C-k" 'edt-define-key)
  689.   (edt-bind-gold-key  "\C-k" 'edt-restore-key)
  690.   (edt-bind-standard-key "\C-l" 'edt-learn)
  691.   ;;; Leave binding of C-m to newline.
  692.   (edt-bind-standard-key "\C-n" 'edt-set-screen-width-80)
  693.   (edt-bind-standard-key "\C-o" 'open-line)
  694.   (edt-bind-standard-key "\C-p" 'fill-paragraph)
  695.   ;;; Leave binding of C-r to isearch-backward.
  696.   ;;; Leave binding of C-s to isearch-forward.
  697.   (edt-bind-standard-key "\C-t" 'edt-display-the-time)
  698.   (edt-bind-standard-key "\C-v" 'redraw-display)
  699.   (edt-bind-standard-key "\C-w" 'edt-set-screen-width-132)
  700.   ;;; Leave binding of C-x as original prefix key.
  701. )
  702.  
  703. ;;;
  704. ;;; LK-201 KEYBOARD USER EDT KEYPAD HELP
  705. ;;;
  706.  
  707. (defun edt-user-keypad-help ()
  708.   "
  709.                                 USER EDT Keypad Active
  710.  
  711.                                   +----------+----------+----------+----------+
  712.    F7: Copy Rectangle             |Prev Line |Next Line |Bkwd Char |Frwd Char |
  713.    F8: Cut Rect Overstrike        |   (UP)   |  (DOWN)  |  (LEFT)  | (RIGHT)  |
  714.  G-F8: Paste Rect Overstrike      |Window Top|Window Bot|Bkwd Sent |Frwd Sent |
  715.    F9: Cut Rect Insert            +----------+----------+----------+----------+
  716.  G-F9: Paste Rect Insert         
  717.   F10: Cut Rectangle
  718. G-F10: Paste Rectangle
  719.   F11: ESC                        +----------+----------+----------+----------+
  720.   F12: Begining of Line           |   GOLD   |Query Repl|  FNDNXT  |Del Ent L |
  721. G-F12: Delete Other Windows       |   (PF1)  |   (PF2)  |   (PF3)  |   (PF4)  |
  722.   F13: Delete to Begin of Word    |Mark Wisel|Other Wind|   FIND   |  UND L   |
  723.  HELP: Keypad Help                +----------+----------+----------+----------+
  724.    DO: Execute extended command   |   PAGE   |Scroll Win|Open Line |  DEL W   |
  725.                                   |    (7)   |    (8)   |    (9)   |   (-)    |
  726.   C-a: Beginning of Line          |Ex Ext Cmd|Fill Parag|Elim Tabs |  UND W   |
  727.   C-b: Switch to Buffer           +----------+----------+----------+----------+
  728.   C-d: Delete Character           |  ADVANCE |  BACKUP  | CUT/COPY |  DEL C   |
  729.   C-e: End of Line                |    (4)   |    (5)   |    (6)   |   (,)    |
  730.   C-f: Forward Character          |   BOTTOM |    TOP   |   Yank   |  UND C   |
  731.   C-g: Keyboard Quit              +----------+----------+----------+----------+
  732. G-C-g: Keyboard Quit              | Fwd Word |    EOL   | Bwd Word |  Change  |
  733.   C-h: Electric Emacs Help        |    (1)   |    (2)   |    (3)   | Direction|
  734. G-C-h: Emacs Help                 | CHNGCASE |  DEL EOL |   COPY   |          |
  735.   C-i: Indent for Tab             +---------------------+----------+  (ENTER) |
  736.   C-j: Duplicate Word             |         LINE        |SELECT/RES|          |
  737.   C-k: Define Key                 |         (0)         |    (.)   |  Toggle  |
  738. G-C-k: Restore Key                |      Open Line      |Center Lin|Insrt/Over|
  739.   C-l: Learn                      +---------------------+----------+----------+
  740.   C-n: Set Screen Width 80       
  741.   C-o: Open Line                       +----------+----------+----------+
  742.   C-p: Fill Paragraph                  |  FNDNXT  |   Yank   |    CUT   |
  743.   C-q: Quoted Insert                   |  (FIND)) | (INSERT) | (REMOVE) |
  744.   C-r: Isearch Backward                |   FIND   |          |   COPY   |
  745.   C-s: Isearch Forward                 +----------+----------+----------+
  746.   C-t: Display the Time                |SELECT/RES|SECT BACKW|SECT FORWA|
  747.   C-u: Universal Argument              | (SELECT) |(PREVIOUS)|  (NEXT)  |
  748.   C-v: Redraw Display                  |          |          |          |
  749.   C-w: Set Screen Width 132            +----------+----------+----------+
  750.   C-z: Suspend Emacs
  751. G-C-\\: Split Window
  752.  
  753.   G-a: Append to Kill Buffer
  754.   G-b: Buffer Menu
  755.   G-c: Compile
  756.   G-d: Delete Window
  757.   G-e: Exit
  758.   G-f: Find File
  759.   G-g: Find File Other Window
  760.   G-h: Keypad Help
  761.   G-i: Insert File
  762.   G-k: Toggle Capitalization Word
  763.   G-l: Lowercase Word or Region
  764.   G-m: Save Some Buffers
  765.   G-n: Next Error
  766.   G-o: Switch Windows
  767.   G-q: Quit
  768.   G-r: Revert File
  769.   G-s: Save Buffer
  770.   G-u: Uppercase Word or Region
  771.   G-v: Find File Other Window
  772.   G-w: Write file
  773.   G-y: EDT Emulation OFF
  774.   G-z: Switch to Default EDT Key Bindings
  775.   G-2: Split Window
  776.   G-%: Go to Percentage
  777.   G- : Undo  (GOLD Spacebar)
  778.   G-=: Go to Line
  779.   G-`: What line"
  780.  
  781.   (interactive)
  782.   (describe-function 'edt-user-keypad-help))
  783.